//
//  JXHComposeTitleView.swift
//  JXHSinaWeiBo
//
//  Created by juxiaohui on 16/10/27.
//  Copyright © 2016年 juxiaohui. All rights reserved.
//

import UIKit
import SnapKit

class JXHComposeTitleView: UIView {

    lazy var titleLabel : UILabel = UILabel()
    lazy var nameLabel : UILabel = UILabel()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension JXHComposeTitleView {
    
    func setupUI() {
        addSubview(titleLabel)
        addSubview(nameLabel)
        titleLabel.text = "发微博"
        titleLabel.font = UIFont.systemFont(ofSize: 16)
        nameLabel.font = UIFont.systemFont(ofSize: 14)
        nameLabel.textColor = UIColor.lightGray
        nameLabel.text = JXHUserAcccountTool.shareInstance.accont?.screen_name
        
        titleLabel.snp.makeConstraints { (make) in
           make.centerX.equalTo(self)
           make.top.equalTo(self)
        }
        
        nameLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(self)
            make.top.equalTo(titleLabel.snp.bottom).offset(3)
        }
    }
}
